package com.joysuch.wwyt.risk.mapper;

import com.joysuch.wwyt.risk.bean.TaskItemEvaItemMappBean;
import com.joysuch.wwyt.risk.entity.RiskDynamicRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zqw
 * @since 2022-04-15
 */
public interface RiskDynamicRecordMapper extends BaseMapper<RiskDynamicRecord> {

    List<RiskDynamicRecord> getRecordsByTypeAndTaskCode(Integer riskType, String taskCode,Integer status, String orgCode, Long tenentId);

    List<RiskDynamicRecord> getLastRecordByTaskCodeAndType(String taskCode, int riskType,String orgCode, Long tenentId);

    List<RiskDynamicRecord> getAllByTaskCodeAndRiskType(String taskCode,Integer riskType,String orgCode, Long tenentId);

    List<RiskDynamicRecord> findAllByTaskCodesAndRiskType(List<String> taskCodes, int riskType,String orgCode, Long tenentId);

    List<RiskDynamicRecord> findAllByRiskDistrictIdsAndStatus(List<Long> districtIds, int status);

    List<RiskDynamicRecord> findAllByRiskType(int riskType,String orgCode, Long tenentId);

    List<RiskDynamicRecord>  findAllByTaskCodeRiskTypeAndStatus(String taskCode, int riskType, int status,String orgCode,Long tenentId);

    List<TaskItemEvaItemMappBean> findEvaItemIdByTaskRecordItemIds(@Param("recordItemIds") Set<Long> recordItemIds);
}
